Optimal. Leaf size=85 \[ \frac {(a+2 b) \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^2 \sqrt {b} f \sqrt {a+b}}-\frac {x}{a^2}+\frac {\tan (e+f x)}{2 a f \left (a+b \tan ^2(e+f x)+b\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {4141, 1975, 471, 522, 203, 205} \[ \frac {(a+2 b) \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^2 \sqrt {b} f \sqrt {a+b}}-\frac {x}{a^2}+\frac {\tan (e+f x)}{2 a f \left (a+b \tan ^2(e+f x)+b\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 205
Rule 471
Rule 522
Rule 1975
Rule 4141
Rubi steps
\begin {align*} \int \frac {\tan ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b \left (1+x^2\right )\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\tan (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {\operatorname {Subst}\left (\int \frac {1-x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{2 a f}\\ &=\frac {\tan (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{a^2 f}+\frac {(a+2 b) \operatorname {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\tan (e+f x)\right )}{2 a^2 f}\\ &=-\frac {x}{a^2}+\frac {(a+2 b) \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^2 \sqrt {b} \sqrt {a+b} f}+\frac {\tan (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 7.68, size = 346, normalized size = 4.07 \[ \frac {\sec ^4(e+f x) (a \cos (2 (e+f x))+a+2 b)^2 \left (\frac {\frac {(a+2 b) \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{3/2}}-\frac {a \sqrt {b} \sin (2 (e+f x))}{(a+b) (a \cos (2 (e+f x))+a+2 b)}}{b^{3/2} f}-\frac {\frac {\left (a^2+8 a b+8 b^2\right ) ((a+2 b) \sin (2 e)-a \sin (2 f x))}{b f (a+b) (\cos (e)-\sin (e)) (\sin (e)+\cos (e)) (a \cos (2 (e+f x))+a+2 b)}+\frac {\left (-a^3+6 a^2 b+24 a b^2+16 b^3\right ) (\cos (2 e)-i \sin (2 e)) \tan ^{-1}\left (\frac {(\cos (2 e)-i \sin (2 e)) \sec (f x) (a \sin (2 e+f x)-(a+2 b) \sin (f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right )}{b f (a+b)^{3/2} \sqrt {b (\cos (e)-i \sin (e))^4}}+16 x}{a^2}\right )}{64 \left (a+b \sec ^2(e+f x)\right )^2} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.68, size = 458, normalized size = 5.39 \[ \left [-\frac {8 \, {\left (a^{2} b + a b^{2}\right )} f x \cos \left (f x + e\right )^{2} + 8 \, {\left (a b^{2} + b^{3}\right )} f x - 4 \, {\left (a^{2} b + a b^{2}\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + {\left ({\left (a^{2} + 2 \, a b\right )} \cos \left (f x + e\right )^{2} + a b + 2 \, b^{2}\right )} \sqrt {-a b - b^{2}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - b \cos \left (f x + e\right )\right )} \sqrt {-a b - b^{2}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right )}{8 \, {\left ({\left (a^{4} b + a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b^{2} + a^{2} b^{3}\right )} f\right )}}, -\frac {4 \, {\left (a^{2} b + a b^{2}\right )} f x \cos \left (f x + e\right )^{2} + 4 \, {\left (a b^{2} + b^{3}\right )} f x - 2 \, {\left (a^{2} b + a b^{2}\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + {\left ({\left (a^{2} + 2 \, a b\right )} \cos \left (f x + e\right )^{2} + a b + 2 \, b^{2}\right )} \sqrt {a b + b^{2}} \arctan \left (\frac {{\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b}{2 \, \sqrt {a b + b^{2}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right )}{4 \, {\left ({\left (a^{4} b + a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b^{2} + a^{2} b^{3}\right )} f\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.47, size = 99, normalized size = 1.16 \[ \frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} {\left (a + 2 \, b\right )}}{\sqrt {a b + b^{2}} a^{2}} - \frac {2 \, {\left (f x + e\right )}}{a^{2}} + \frac {\tan \left (f x + e\right )}{{\left (b \tan \left (f x + e\right )^{2} + a + b\right )} a}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.95, size = 108, normalized size = 1.27 \[ \frac {\tan \left (f x +e \right )}{2 a f \left (a +b +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}+\frac {\arctan \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {\left (a +b \right ) b}}\right )}{2 f a \sqrt {\left (a +b \right ) b}}+\frac {b \arctan \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {\left (a +b \right ) b}}\right )}{f \,a^{2} \sqrt {\left (a +b \right ) b}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.42, size = 75, normalized size = 0.88 \[ \frac {\frac {\tan \left (f x + e\right )}{a b \tan \left (f x + e\right )^{2} + a^{2} + a b} + \frac {{\left (a + 2 \, b\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a^{2}} - \frac {2 \, {\left (f x + e\right )}}{a^{2}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.00, size = 711, normalized size = 8.36 \[ \frac {\mathrm {tan}\left (e+f\,x\right )}{2\,a\,f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}-\frac {x}{a^2}-\frac {\mathrm {atan}\left (\frac {\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,b+4\,a\,b^2+8\,b^3\right )}{2\,a^2}-\frac {\left (2\,a\,b^2-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (16\,a^5\,b^2+32\,a^4\,b^3\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{8\,a^2\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}\,1{}\mathrm {i}}{4\,\left (a^3\,b+a^2\,b^2\right )}+\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,b+4\,a\,b^2+8\,b^3\right )}{2\,a^2}+\frac {\left (2\,a\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (16\,a^5\,b^2+32\,a^4\,b^3\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{8\,a^2\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}\,1{}\mathrm {i}}{4\,\left (a^3\,b+a^2\,b^2\right )}}{\frac {b^2+\frac {a\,b}{2}}{a^3}-\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,b+4\,a\,b^2+8\,b^3\right )}{2\,a^2}-\frac {\left (2\,a\,b^2-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (16\,a^5\,b^2+32\,a^4\,b^3\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{8\,a^2\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}+\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,b+4\,a\,b^2+8\,b^3\right )}{2\,a^2}+\frac {\left (2\,a\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (16\,a^5\,b^2+32\,a^4\,b^3\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{8\,a^2\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}}{4\,\left (a^3\,b+a^2\,b^2\right )}}\right )\,\left (a+2\,b\right )\,\sqrt {-b\,\left (a+b\right )}\,1{}\mathrm {i}}{2\,f\,\left (a^3\,b+a^2\,b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________